<%@ include file="includes/top.jsp"%>

<table align="left" bgcolor="#008800" border="0" cellspacing="2" cellpadding="2">
	<tr>
		<td bgcolor="#FFFF88">
			<s:a action="/shop/index.do">
				<b><font color="BLACK" size="2">&lt;&lt; Main Menu</font></b>
			</s:a>
		</td>
	</tr>
	
	<tr>
		<td bgcolor="#FFFF88">
			<s:a action="/shop/viewOrder.do?webservice=true">
				<s:param id="orderId" name="order" value="orderId"/>
				<b><font color="BLACK" size="2">Use Web Service</font></b>
			</s:a>
		</td>
	</tr>
</table>

<s:if test="${!empty message}">
	<center><b><s:property value="${message}"/></b></center>
</s:if>

<table width="60%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFF88">
	<tr bgcolor="#FFFF88">
		<td align="center" colspan="2">
			<font size="4"><b>Order	#<s:property value="${order.orderId}"/></b></font>
			<br/>
			<font size="3"><b><fmt:formatDate value="${order.orderDate}" pattern="yyyy/MM/dd hh:mm:ss"/></b></font>
		</td>
	</tr>
		
	<tr bgcolor="#FFFF88">
		<td colspan="2"><font color="GREEN" size="4"><b>Payment	Details</b></font></td>
	</tr>
	
	<tr bgcolor="#FFFF88">
		<td>Card Type:</td>
		<td><s:property value="${order.cardType}" /></td>
	</tr>
	
	<tr bgcolor="#FFFF88">
		<td>Card Number:</td>
		<td><s:property value="${order.creditCard}" /> <font color="red" size="2">* Fake number!</font></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Expiry Date (MM/YYYY):</td>
		<td><s:property value="${order.expiryDate}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td colspan="2"><font color="GREEN" size="4"><b>Billing	Address</b></font></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>First name:</td>
		<td><s:property value="${order.billToFirstName}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Last name:</td>
		<td><s:property value="${order.billToLastName}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Address 1:</td>
		<td><s:property value="${order.billAddress1}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Address 2:</td>
		<td><s:property value="${order.billAddress2}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>City:</td>
		<td><s:property value="${order.billCity}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>State:</td>
		<td><s:property value="${order.billState}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Zip:</td>
		<td><s:property value="${order.billZip}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Country:</td>
		<td><s:property value="${order.billCountry}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td colspan="2"><font color="GREEN" size="4"><b>Shipping Address</b></font></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>First name:</td>
		<td><s:property value="${order.shipToFirstName}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Last name:</td>
		<td><s:property value="${order.shipToLastName}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Address 1:</td>
		<td><s:property value="${order.shipAddress1}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Address 2:</td>
		<td><s:property value="${order.shipAddress2}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>City:</td>
		<td><s:property value="${order.shipCity}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>State:</td>
		<td><s:property value="${order.shipState}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Zip:</td>
		<td><s:property value="${order.shipZip}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Country:</td>
		<td><s:property value="${order.shipCountry}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td>Courier:</td>
		<td><s:property value="${order.courier}" /></td>
	</tr>
	<tr bgcolor="#FFFF88">
		<td colspan="2"><b><font color="GREEN" size="4">Status:</font><s:property value="${order.status}"/></b></td>
	</tr>
	
	<tr bgcolor="#FFFF88">
		<td colspan="2">
			<table width="100%" align="center" bgcolor="#008800" border="0" cellspacing="2" cellpadding="3">
				<tr bgcolor="#CCCCCC">
					<td><b>Item ID</b></td>
					<td><b>Description</b></td>
					<td><b>Quantity</b></td>
					<td><b>Price</b></td>
					<td><b>Total Cost</b></td>
				</tr>
				
				<s:iterator value="lineItem" id="${order.lineItems}">
					<tr bgcolor="#FFFF88">
						<td>
							<s:a href="/shop/viewItem.do">
								<s:param name="itemId" value="${lineItem.itemId}"/>
								<b><font color="BLACK"><s:property value="${lineItem.itemId}"/></font></b>
							</s:a>
						</td>
						
						<td>
							<s:property value="${lineItem.item.attribute1}" />
							<s:property	value="${lineItem.item.attribute2}" />
							<s:property value="${lineItem.item.attribute3}" />
							<s:property	value="${lineItem.item.attribute4}" /> 
							<s:property	value="${lineItem.item.attribute5}" /> 
							<s:property	value="${lineItem.item.product.name}" />
						</td>
						
						<td>
							<s:property value="${lineItem.quantity}"/>
						</td>
						
						<td align="right">
							<fmt:formatNumber value="${lineItem.unitPrice}" pattern="$#,##0.00" />
						</td>
						
						<td align="right">
							<fmt:formatNumber value="${lineItem.totalPrice}" pattern="$#,##0.00" />
						</td>
					</tr>
				</s:iterator>
				
				<tr bgcolor="#FFFF88">
					<td colspan="5" align="right">
						<b>Total: <fmt:formatNumber	value="${order.totalPrice}" pattern="$#,##0.00" /></b>
					</td>
				</tr>
				
			</table>
		</td>
	</tr>

</table>

<%@ include file="includes/bottom.jsp"%>
